#ifndef _FLOADERFREETYPE_H_
#define _FLOADERFREETYPE_H_

#include "FLoader.h"

namespace Font
{

	class LoaderFreeType : public Loader
	{
	
	public:
	
		LoaderFreeType(Library* a_Library);
		~LoaderFreeType();
	
		bool LoadDefault();
		Face* LoadFace(Family* a_Family, const tb::String& a_Settings);

		Metrics* CreateMetrics(Family* a_Family, unsigned int a_Style, CharMap* a_CharMap);

	protected:

		FT_Library m_FTLibrary;

		struct FontData
		{
			FT_Byte* data;
			unsigned int data_size;
			FT_Face face;
		};

		FontData* _CreateFontData(unsigned int a_DataSize);

		std::vector<FontData*> m_FontData;
		std::map<std::string, FontData*> m_FontDataByName;
	
	}; // class LoaderFreeType

}; // namespace Font
	
#endif